<?php include_once './application/views/sys_admin/common/header.php';  ?>
<!-- admin_main -->
<?php 
	$borrow_check = array(0=>'未检查',1=>'数据已检查');
?>
<div class="form-inline definewidth m20">
	<h3>标的产品简介</h3>
	<table class="table table-bordered table-hover m10">
		 <tr>
			<td  class="tableleft">标的名称
		 	</td>
		 </br>
	        <td><?php echo $borrow['title'];?></td>
	        <td class="tableleft">产品亮点</td>
	        <td><?php echo $borrow['summary'];?></td>
	     </tr>
	</table>
	   		
	
	<h3>标的产品描述</h3>
	<table class="table table-bordered table-hover m10">
		<tr>
		 	<td class="tableleft">融资金额</td>
		 	<td><?php echo number_format($borrow['account'],2);?></td>
		 	<td class="tableleft">收益利率</td>
		 	<td><?php echo $borrow['apr'];?>%</td>
		 	<td class="tableleft">标的类型</td>
		 	<td><?php echo $borrow_type[$borrow['ftype']];?></td>
		</tr>
		<tr>
		 	<td class="tableleft"> 标的状态</td>
		 	<td><?php echo $borrow_status[$borrow['fstatus']];?></td>
		 	<td class="tableleft">标的期限</td>
		 	<td><?php if($borrow['is_day'] == 1){echo $borrow['time_limit_day'].'天';}else{$borrow['time_limit'].'个月';}?></td>
		 	<td class="tableleft">投资周期</td>
		 	<td><?php echo $borrow['bill_times'];?>天</td>
		</tr>
		<tr>
		 	<td class="tableleft">标的起始时间</td>
		 	<td><?php echo date('Y-m-d H:i',$borrow['bill_starttime']);?></td>
		 	<td class="tableleft">起息时间</td>
		 	<td><?php echo $borrow_work_time[$borrow['work_time']];?></td>
		 	<td class="tableleft">预约发标时间</td>
		 	<td><?php if($borrow['auto_verify_time'] > 0){ echo  date('Y-m-d H:i',$borrow['auto_verify_time']);}else{echo '&nbsp;';}?></td>
		</tr>
		<tr>
		 	<td class="tableleft">还款日</td>
		 	<td><?php if($borrow['each_time'] > 0){  echo date('Y-m-d H:i',$borrow['each_time']);}else{ echo '&nbsp;';}?></td>
		 	<td class="tableleft">还款方式</td>
		 	<td><?php echo $borrow_style[$borrow['style']];?></td>
		 	<td class="tableleft">投资有效期</td>
		 	<td><?php echo $borrow['valid_time'];?>天</td>
		</tr>
		<tr>
		 	<td class="tableleft">最小投标金额</td>
		 	<td><?php echo number_format($borrow['lowest_account'],2);?>元</td>
		 	<td class="tableleft">最大投标金额</td>
		 	<td><?php echo $borrow['most_account']>0 ? number_format($borrow['most_account'],2)."元":"无限制";?></td>
		 	<td class="tableleft">客户奖励</td>
		 	<td><?php if($borrow['award'] > 0){?><?php echo $borrow_award[$borrow['award']];?>：<font><?php echo $borrow['funds'];?><?php }?></td>
		</tr>
		<tr>
		 	<td class="tableleft">标的安全等级</td>
		 	<td>最高级别</td>
		 	<td class="tableleft">自动投标比例</td>
		 	<td><?php echo $borrow['auto_apr'];?>%</td>
		 	<td class="tableleft">借款用户编号</td>
		 	<td><?php echo $borrow['user_id'];?></td>
		</tr>
		<tr>
		 	<td class="tableleft">担保用户编号</td>
		 	<td><?php echo $borrow['loan_userid'];?> </td>
		 	<td class="tableleft">逾期日利率</td>
		 	<td><?php echo $borrow['late_apr'];?></td>
		 	<td class="tableleft">可逾期天数</td>
		 	<td><?php echo $borrow['late_days'];?>天</td>
		</tr>
	</table>
	
	<h3>背景调查审核</h3>
	<?php if($list){?>
			<?php foreach($list as $val){?>
				<h4><?php echo $borrow_fsubject[$val['id']];?></h4>
				<img width="60px" height="60px" src="<?php echo CONSET_SUBJECT_IMG.$val['pic']?>"/></br> 
				审核资料有效期：<?php echo $val['valid'];?>个月</br> 
				资料提交说明：<?php echo $val['content'];?></br> 
		<?php }?>
       <?php }else{?>
               	暂无数据
        <?php }?>				
	<hr></br>
	
	<h3>标的安全性审核</h3>
	<table class="table table-bordered table-hover m10">

		<?php if($borrow['ftype'] == 1){?>
		<tr>
		 	<td class="tableleft">真伪鉴定</td>
		 	<td><?php echo $borrow['bill_identification'];?></td>
		 	<td class="tableleft">鉴定单位</td>
		 	<td><?php echo $borrow['bill_unit'];?></td>
		 	<td class="tableleft">完好性</td>
		 	<td><?php echo $borrow_good[$borrow['bill_good']];?></td>
		</tr>
		<tr>
		 	<td class="tableleft">字体清晰度</td>
		 	<td><?php echo $borrow['bill_clarity'];?></td>
		 	<td class="tableleft">用章合规性</td>
		 	<td><?php echo $borrow['bill_compliance'];?></td>
		 	<td class="tableleft">担保方</td>
		 	<td><?php echo $borrow['bill_guarantor'];?></td>
		</tr>
		<tr>
		 	<td class="tableleft">承兑银行</td>
		 	<td><?php echo $borrow_bill_bank[$borrow['bill_bank']];?></td>
		 	<td class="tableleft">资金用途</td>
		 	<td><?php echo $borrow['fuse'];?></td>
		 	<td class="tableleft">保障方式</td>
		 	<td><?php echo $borrow['security_mode'];?></td>
		</tr>
		<tr>
		<td class="tableleft">质押借款协议</td>
		 <td colspan="8" ><img style="width:200px; height:200px;"  src="/<?php echo $borrow['bill_protocol'];?>"/></td>
		</tr>
	
		<?php }elseif ($borrow['ftype'] == 2){?>
		<tr>
		 	<td class="tableleft">借款人信息</td>
		 	<td><?php echo $borrow['bill_identification'];?></td>
		 	<td class="tableleft">借款描述</td>
		 	<td><?php echo $borrow['bill_unit'];?></td>
		 	<td class="tableleft">还款来源</td>
		 	<td><?php echo $borrow['bill_clarity'];?></td>
		 	<td class="tableleft">抵押详情</td>
		 	<td><?php echo $borrow['security_mode'];?></td>
		 	<td class="tableleft">产品亮点</td>
		 	<td><?php echo $borrow['summary'];?></td>
		</tr>
		<?php }elseif ($borrow['ftype'] == 3){?>
		<tr>
		 	<td class="tableleft">借款人信息</td>
		 	<td><?php echo $borrow['bill_identification'];?></td>
		 	<td class="tableleft">借款描述</td>
		 	<td><?php echo $borrow['bill_unit'];?></td>
		 	<td class="tableleft">还款来源</td>
		 	<td><?php echo $borrow['bill_clarity'];?></td>
		 	<td class="tableleft">抵押详情</td>
		 	<td><?php echo $borrow['security_mode'];?></td>
		 	<td class="tableleft">产品亮点</td>
		 	<td><?php echo $borrow['summary'];?></td>
		</tr>
		<?php }?>
	</table>

	
	
	<h3>复审</h3>
	
	<input type="hidden" id="borrow_id" name="borrow_id" value="<?php echo $borrow['id'];?>" />
	状态:<input type="radio" name="fstatus" id="fstatus" value="3" checked="checked" />复审通过 <input type="radio" name="fstatus" id="fstatus" value="4" />复审不通过</h3><br><br>
	复审留言：<br>
	<textarea rows="8" cols="100" id="repayment_remark" name="repayment_remark"></textarea>
	<button type="button" class="btn btn-success"  onclick="borrow_submit();" >提交</button>
</div>

<script type="text/javascript">

function borrow_submit(){
	$('#dialog').dialog({
		modal:true,
		title:'系统提示',
	});
	$("#msg").html("正在审核……请耐心等候！");
	
	$.ajax({
		type: "POST",
		url: "/sys_admin/borrow/review/",
		data: "id="+$('#borrow_id').val()+"&fstatus="+$('input[name="fstatus"]:checked').val()+"&repayment_remark="+$('#repayment_remark').val(),
		success: function(msg){
	        $("#dialog" ).dialog();
	        if(msg == 1){
	        	$("#msg").html("审核成功！");
	        	window.location.href='/sys_admin/borrow/zhs_borrow_repayment_list/';
	        }else{
				$("#msg").html("审核失败，请联系管理员！");
	        }

	        
			//setTimeout(function(){
				//window.close();
			//},3000);
		},
		dataType: "text"
	});
}

</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
